package com.yunxi.yunxicaiproject.Controller;

import com.yunxi.yunxicaiproject.entity.vo.ScheduleVO;
import com.yunxi.yunxicaiproject.tool.StudentTools;
import com.yunxi.yunxicaiproject.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/ai")
public class ScheduleController {
    @Autowired
    StudentTools studentTools;

    @GetMapping("/schedule")
    public R list(String studentId){
        if (studentId==null){
            return R.error("学生学号为空！");
        }
        List<ScheduleVO> vo= studentTools.getSchedule(studentId);
        return R.ok().put("data", vo);
    }
}
